<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <script type="text/javascript" src="./script/jquery.min.js"></script>
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav" style="padding-top:25px;">
        <a class="aui-pull-left aui-btn" onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">E文通</div>
        <a class="aui-pull-right aui-btn nav-btn">

        </a>
    </header>
<div class="head-d"></div>
    <div class="form">
        <h3>申请原因：</h3>
        <textarea name="" id="con"></textarea>
        <button type="button" class="aui-btn aui-btn-success aui-btn-sm" onclick="sub();" style="display: none" id="sub_btn">提交</button>
    </div>


    <!-- <div class="foot-t"></div>
<ul class="foot">
  <li>
    <i class="aui-iconfont aui-icon-home"></i>
    <p>首页</p>
  </li>
  <li>
    <i class="aui-iconfont aui-icon-my"></i>
    <p>我的</p>
  </li>
</ul>
</body> -->

    <script type="text/javascript" src="./script/api.js"></script>
    <script type="text/javascript">
        function openClub() {
            var delay = 0;
            if (api.systemType != 'ios') {
                delay = 300;
            }
            api.openWin({
                name: 'club_win',
                url: './html/club_win.html',
                bounces: false,
                delay: delay,
                slidBackEnabled: true,
                vScrollBarEnabled: false,
                progress: {
                    type: "page"
                }
            });
        }
        $(".nav-btn").on("click", function() {
            $(".nav").slideToggle(100);
        })
        $(".nav .aui-list-item").on("click", function() {
            $(".nav").hide();
        })

        function closeWin() {
            api.closeWin({});
        }

        var con_id = '';
        var sender_id = '';
        apiready = function() {
            con_id = api.pageParam.con_id; // 文章id
            sender_id = api.pageParam.sender_id; // 审核人id
            $("#sub_btn").show();
        }

        function sub() {
          // alert(JSON.stringify(111111));
            var content = $("#con").val();
            var userid = $api.getStorage('id');
            api.ajax({
                url: 'http://oa.big-wealth.com/index.php?m=&c=info&a=info_apply&api_auth_id=' + userid,
                method: 'post',
                data: {
                    values: {
                        i_id: con_id,
                        u_id: userid,
                        content: content,
                        a_id: sender_id
                    }
                }
            }, function(ret, err) {
              // alert(JSON.stringify(ret));
              if (ret) {
                if (ret.status == 200) {
                  alert("申请成功！");
                  api.closeToWin({
                      name: 'home'
                  });
                }
              }


            });

        }
    </script>

</html>
